package com.leadingsoft.pwxk.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.leadingsoft.common.converter.AbstractConverter;
import com.leadingsoft.pwxk.dto.PwBaseInfoDto;
import com.leadingsoft.pwxk.model.PwBaseInfo;

/**
 * @author: lipan 2018年5月15日
 * @description: ()
 * 
 */

@Component
public class PwBaseInfoConverter extends AbstractConverter<PwBaseInfo, PwBaseInfoDto> {

	@Autowired
	private ContaminantConverter contaminantConverter;

	@Autowired
	private HppfwjConverter hppfwjConverter;

	@Override
	protected PwBaseInfoDto toDtoActual(PwBaseInfo model) {
		// TODO Auto-generated method stub

		PwBaseInfoDto dto = new PwBaseInfoDto();
		dto.setId(model.getId());
		dto.setDataid(model.getDataid());
		dto.setAircontrol(model.getAircontrol());
		dto.setAircontrolcode(model.getAircontrolcode());
		dto.setCreditcode(model.getCreditcode());
		dto.setDevcompany(model.getDevcompany());
		dto.setDevlegalperson(model.getDevlegalperson());
		dto.setDevphone(model.getDevphone());
		dto.setEngineeers(model.getEngineeers());
		dto.setEnterid(model.getEnterid());
		dto.setHyid(model.getHyid());
		dto.setHyname(model.getHyname());
		dto.setIndustrial(model.getIndustrial());
		dto.setInformation(model.getInformation());
		dto.setIshppfname(model.getIshppfname());
		dto.setIsmaintainname(model.getIsmaintainname());
		dto.setIsoperaname(model.getIsoperaname());
		dto.setIspark(model.getIspark());
		dto.setIsphosphorus(model.getIsphosphorus());
		dto.setIspollutantsname(model.getIspollutantsname());
		dto.setIsshortpermit(model.getIsshortpermit());
		dto.setIsspecialname(model.getIsspecialname());
		dto.setIsstsname(model.getIsstsname());
		dto.setLatitude(model.getLatitude());
		dto.setMaintainwh(model.getMaintainwh());
		dto.setManagement(model.getManagement());
		dto.setOpeaddress(model.getOpeaddress());
		dto.setOperatime(model.getOperatime());
		dto.setOrgancode(model.getOrgancode());
		dto.setPollutantswh(model.getPollutantswh());
		dto.setPostcode(model.getPostcode());
		dto.setQthyid(model.getQthyid());
		dto.setQthyname(model.getQthyname());
		dto.setRegaddress(model.getRegaddress());
		dto.setLongitude(model.getLongitude());
		dto.setTypename(model.getTypename());
		dto.setWatercontrol(model.getWatercontrol());
		dto.setWatercontrolcode(model.getWatercontrolcode());

		dto.setContaminants(contaminantConverter.toDto(model.getContaminants()));
		dto.setHppfwjlist(hppfwjConverter.toDto(model.getHpPfwjList()));

		return dto;
	}

	@Override
	public void copyProperties(PwBaseInfo model, PwBaseInfoDto dto) {
		// model.setId(dto.getId());
		// model.setDataid(dto.getDataid());
		model.setAircontrol(dto.getAircontrol());
		model.setAircontrolcode(dto.getAircontrolcode());
		model.setCreditcode(dto.getCreditcode());
		model.setDevcompany(dto.getDevcompany());
		model.setDevlegalperson(dto.getDevlegalperson());
		model.setDevphone(dto.getDevphone());
		model.setEngineeers(dto.getEngineeers());
		model.setEnterid(dto.getEnterid());
		model.setHyid(dto.getHyid());
		model.setHyname(dto.getHyname());
		model.setIndustrial(dto.getIndustrial());
		model.setInformation(dto.getInformation());
		model.setIshppfname(dto.getIshppfname());
		model.setIsmaintainname(dto.getIsmaintainname());
		model.setIsoperaname(dto.getIsoperaname());
		model.setIspark(dto.getIspark());
		model.setIsphosphorus(dto.getIsphosphorus());
		model.setIspollutantsname(dto.getIspollutantsname());
		model.setIsshortpermit(dto.getIsshortpermit());
		model.setIsspecialname(dto.getIsspecialname());
		model.setIsstsname(dto.getIsstsname());
		model.setLatitude(dto.getLatitude());
		model.setMaintainwh(dto.getMaintainwh());
		model.setManagement(dto.getManagement());
		model.setOpeaddress(dto.getOpeaddress());
		model.setOperatime(dto.getOperatime());
		model.setOrgancode(dto.getOrgancode());
		model.setPollutantswh(dto.getPollutantswh());
		model.setPostcode(dto.getPostcode());
		model.setQthyid(dto.getQthyid());
		model.setQthyname(dto.getQthyname());
		model.setRegaddress(dto.getRegaddress());
		model.setLongitude(dto.getLongitude());
		model.setTypename(dto.getTypename());
		model.setWatercontrol(dto.getWatercontrol());
		model.setWatercontrolcode(dto.getWatercontrolcode());

	}

}
